/*
 * author      : 吴中勤 
 * date        : 2019/3/31
 * description : TODO
 */

package org.wzq.learn.infrastructure.framework.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.wzq.learn.infrastructure.framework.CustomHandlerInterceptor;

@Configuration
public class CustomWebConfig implements WebMvcConfigurer {
    @Autowired
    ApplicationContext applicationContext;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.applicationContext.getBean(CustomHandlerInterceptor.class));
    }

}
